package com.mallcloud.mall.mall.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mallcloud.mall.common.core.constant.enums.mall.PointsCouponEnum;
import com.mallcloud.mall.common.core.util.ValidGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@ApiModel(value = "MallMyUsedCouponModel", description = "已使用券")
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("V_QLISTSY")
public class MallMyUsedCouponModel implements Serializable {
	private static final long serialVersionUID = 1L;

	@JsonSerialize(using = ToStringSerializer.class)
	@NotNull(message = "ID为空", groups = {ValidGroup.Update.class})
	@ApiModelProperty(value = "序号")
	@TableId("tcftseqno")
	private Long id;

	@ApiModelProperty(value = "卡号")
	@TableField("vheucno")
	private String cardNo;

	@ApiModelProperty(value = "券号")
	@TableField("vhetcftvipno")
	private String couponNo;

	@ApiModelProperty(value = "券可兑换金额")
	@TableField("vheqje")
	private BigDecimal redeemMoney;

	@ApiModelProperty(value = "券种类")
	@TableField("vheqtype")
	private String type;

	@ApiModelProperty(value = "券种名称")
	@TableField("tqname")
	private String name;

	/**
	 * {@link PointsCouponEnum.StatusEnum}
	 */
	@ApiModelProperty(value = "券状态")
	@TableField("vheqstatus")
	private String status;

	@ApiModelProperty(value = "开始日期")
	@TableField("vhestartdate")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
	private Date startDate;

	@ApiModelProperty(value = "结束日期")
	@TableField("vheenddate")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
	private Date endDate;

	@ApiModelProperty(value = "领取日期")
	@TableField("vhelqrq")
	private String getTime;

	@ApiModelProperty(value = "收券规则说明")
	@TableField("sqgz")
	private String couponRule;
}
